export function KMXResponseInterceptor(response:any) {
  return response.then((json:any) => {
    if (json.code === 1) {
      throw new Error(json.message);
    }
    return json.body;
  });
} 

export function ESResponseInterceptor(response:any) {
  return response.then((json:any) => {
    if (json.error) {
      throw new Error(json.error);
    }
    return json;
  });
}